#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

/**
 * Definition for singly-linked list.
 */
struct ListNode {
	int val;
	struct ListNode* next;
};
typedef struct ListNode listNode, *listnode;

struct ListNode* getKthFromEnd(struct ListNode* head, int k);

int main()
{
	return 0;
}

struct ListNode* getKthFromEnd(struct ListNode* head, int k)
{
	listnode kF = head;
	for (int i = k; kF && i; i--, kF = kF->next) ;

	listnode res = head;
	for (; kF; kF = kF->next, res = res->next) ;

	return res;
}
